﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;

namespace SiteAnalys
{
    class Program
    {
        static void Main(string[] args)
        {
            Regex regEx = new Regex("[A-Za-z]?[A-Za-z]");
            string results;
            WebClient wbClient = new WebClient();
            wbClient.Encoding = Encoding.UTF8;
            string content = wbClient.DownloadString("http://society.actualno.com/news_373504.html");
            //string plainText = Regex.Replace(content, "<[^>]+?>", "");
            MatchCollection plainText = Regex.Matches(content, "[A-Za-z]?[A-Za-z]");
            TextWriter tw = new StreamWriter(@"D:\\data.txt");
            for (int i = 0; i < plainText.Count; i++)
			{
                tw.WriteLine(plainText[i]);
            }
            tw.Close();
            //Console.WriteLine(plainText);
            //string[] split = content.Split(new char[] {' '});

            ////for (int i = 0; i < split.Length; i++)
            ////{
            ////    Console.WriteLine(split[i]);
            ////}
            //int count = 0;
            //foreach (var word in split)
            //{
            //    if (Regex.IsMatch(content, "[A-Za-z]?[A-Za-z]"))
            //    {
            //        Console.WriteLine(split[count]);
            //    }
            //    count++;
            //}
        }
    }
}
